<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <title>Blog</title>
    <link rel='stylesheet' href='/stylesheets/header.css'>
    <link rel='stylesheet' href='/stylesheets/blog.css'>
    <link rel="stylesheet" href="/kindeditor/plugins/code/prettify.css">
    <script src="/kindeditor/plugins/code/prettify.js"></script>
    <script>prettyPrint();</script>
</head>
<body>
<header class="header" id="header">
    <div class="h-container">
        <h1 class="nav-log">
            <a class="nav-log-text nav-color" href="/">禾水<span class="nav-log-description">-前端学习之路</span></a>
        </h1>
        <nav class="nav">
            <ul class="nav-list">
                <li><a class="nav-color" href="/">首页</a></li>
                <li><a class="nav-color active" href="/blog">BLOG</a></li>
                <li><a class="nav-color" href="/demo">DEMO</a></li>
                <% if(user) { %>
                <li><a class="nav-color" href="/post">发表</a></li>
                <li><a class="nav-color" href="/logout">登出</a></li>
                <% }else { %>
                <li><a class="nav-color" href="/login">登录</a></li>
                <li><a class="nav-color" href="/reg">注册</a></li>
                <% } %>
            </ul>
        </nav>
    </div>
</header>
<!--<div class="" style="position: fixed;background: url('/images/banner-other-1.jpg') repeat;height: 300px;width: 100%;"></div>-->
<div class="blog-contain1">
    <% posts.forEach(function (post,index) { id = post._id.toString(); %>
    <div class="blog-contain2 clear">
    <a class="b-c-a-title" href="/id/<%= id %>"><h2 class="b-c-title">&nbsp;&nbsp;<%= post.title %></h2></a>
    <p class="b-c-writer"><a href="/u/<%= post.name %>"><%= post.name %></a>&nbsp;&nbsp;发布于<%= post.time.minute %></p>
    <article class="b-c-article"><p><%- post.post %></p></article>
    <a class="b-c-lookmore clear" href="/id/<%= id %>">>>>查看更多</a>
    </div>
    <% }) %>
</div>
<article>
    <% if (success) { %>
    <div><%= success %></div>
    <% } %>
    <% if (error) { %>
    <div><%= error %></div>
    <% } %>
</article>
</body>
</html>
